require('es6-promise').polyfill();

import axios from 'axios'

function loadSysRoleUserData(data) {
  console.log(data)
  return {
    type: 'LOAD_SYSROLEUSER_DATA',
    data
  }
}

export function loadSysRoleUserDataAsync(data) {
  return function(dispatch) {
    return axios.post('/api/sysroleuser',data).then(
      resp => dispatch(loadSysRoleUserData(resp.data)),
      error => dispatch(loadSysRoleUserData([]))
    );
  };
}
